<template>
  <div>
    <h1>如花</h1>
    <!-- <h3>{{ $store.state.user.username }}</h3> -->
    <h3>{{ age }}</h3>
    <h3>{{ pingfang }}</h3>
    <button @click="updateAge(2)">让年龄加2</button>
    <button @click="asdasd3s(1)">让年龄两秒后加1</button>
  </div>
</template>

<script>
import { mapState, mapGetters, mapMutations, mapActions } from 'vuex'
export default {
  name: 'MyApp',
  computed: {
    ...mapState('user', ['age']),
    ...mapGetters('user', ['pingfang'])
  },
  methods: {
    ...mapMutations('user', ['updateAge']),
    ...mapActions('user', ['asdasd3s'])
  }
}
</script>

<style lang="less" scoped></style>
